namespace SPDeploy.Library.Helpers
{
    using System;
    using System.IO;
    using System.Xml.Serialization;

    internal class XmlDeserializer
    {
        #region Methods: public

        public static T Deserialize<T>(string s)
            where T : class
        {
            return Deserialize(typeof (T), s) as T;
        }

        public static object Deserialize(Type t, string s)
        {
            var serializer = new XmlSerializer(t);
            return serializer.Deserialize(new StringReader(s));
        }

        #endregion
    }
}